﻿/**********************************天使物流*******************************************
* 功能描述:基本信息-货主
* 作者:李周蓬
* 时间:
* 
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.BaseInfo.Owners;
using TianShiProject.Models.Common;
using Volo.Abp.Application.Services;

namespace TianShiProject.BaseInfo.Owners
{
    public class OwnerService : ApplicationService
    {
        private readonly IOwnerRepository _ownerRepository;
        public OwnerService(IOwnerRepository ownerRepository)
        {
            _ownerRepository=ownerRepository;
        }
        /// <summary>
        /// 显示货主
        /// </summary>
        /// <param name="name"></param>
        /// <param name="phone"></param>
        /// <param name="time"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<OwnerDto>> GetShowOwner(string name, string phone, DateTime? time, int pageindex=1, int pagesize=3)
        {
            return await _ownerRepository.GetShowOwner(name,phone,time,pageindex,pagesize);
        }
        /// <summary>
        /// 删除货主
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelOwner(int id)
        {
            return await _ownerRepository.DeleteDelOwner(id);
        }
        /// <summary>
        /// 批量删除货主
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelsOwner(string ids)
        {
            return await _ownerRepository.DeleteDelsOwner(ids);
        }
        /// <summary>
        /// 编辑修改
        /// </summary>
        /// <param name="OwnerDto"></param>
        /// <returns></returns>
        public async Task<int> PutUpdateOwner(OwnerDto OwnerDto)
        {
            return await _ownerRepository.PutUpdateOwner(OwnerDto);
        }
        /// <summary>
        /// 添加货主
        /// </summary>
        /// <param name="OwnerDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddOwner(OwnerDto OwnerDto)
        {
            return await _ownerRepository.PostAddOwner(OwnerDto);
        }
        /// <summary>
        /// 绑定外协单位
        /// </summary>
        /// <returns></returns>
        public async Task<List<OutsourceDto>> GetShowOutsource()
        {
            return await _ownerRepository.GetShowOutsource();
        }
    }
}
